<?php

class Myzen_View_Helper_MessagePath extends Zend_View_Helper_Abstract {
    
    public function messagePath() {
      $data = '<h2>';
      $data.= '<a href="'.$this->view->baseURL().'/apidesigner/">Modules</a>';
      if(empty($this->view->controllerName)) $data.= ' > '.$this->view->moduleName;
      else $data.= ' > <a href="'.$this->view->baseURL().'/apidesigner/'.$this->view->moduleName.'/">'.$this->view->moduleName.'</a>';
      if(!empty($this->view->controllerName)) {
        if(empty($this->view->actionName))  $data.= ' > '.$this->view->controllerName;     
        else $data.= ' > <a href="'.$this->view->baseURL().'/apidesigner/'.$this->view->moduleName.'/'.$this->view->controllerName.'/">'.$this->view->controllerName.'</a>';
        if(!empty($this->view->actionName)) {
          if(empty($this->view->action))  $data.= ' > '.$this->view->actionName;
          else $data.= ' > <a href="'.$this->view->baseURL().'/apidesigner/'.$this->view->moduleName.'/'.$this->view->controllerName.'/'.$this->view->actionName.'/">'.$this->view->actionName.'</a>';
          if(!empty($this->view->action)) $data.= ' > '.$this->view->action;
          if(!empty($this->view->id)) $data.= ' old version '.$this->view->id;
        } //end empty actionName
      } //end not empty controllerName
        
        $data .= '</h2>';
      return $data; 
    } //end function messagePath
} //end class